package com.roy.rocketmq.basic;

import com.alibaba.fastjson.JSON;
import org.apache.rocketmq.spring.annotation.ConsumeMode;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.apache.rocketmq.spring.core.RocketMQReplyListener;
import org.springframework.stereotype.Component;

/**
 * 注意下@RocketMQMessageListener这个注解的其他属性
 * @author ：楼兰
 * @date ：Created in 2020/10/22
 * @description: https://blog.csdn.net/zhoudingding/article/details/106942574
 **/
@Component
@RocketMQMessageListener(
        consumerGroup = "dddGroup",
        topic = "ddd",
        consumeMode= ConsumeMode.CONCURRENTLY
)
public class SpringReConsumer implements RocketMQReplyListener<String,String> {


    @Override
    public String onMessage(String message) {
        System.out.println(" ddd Received message : "+ JSON.toJSONString(message));
        return message;
    }
}
